package com.buynow.cctapi.util.security;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.authentication.configurers.GlobalAuthenticationConfigurerAdapter;

@Configuration
public class WebSecurityConfiguration extends GlobalAuthenticationConfigurerAdapter {


    @Override
    public void init(AuthenticationManagerBuilder auth) throws Exception {
        //auth.userDetailsService(userService);
        //暂时使用基于内存的AuthenticationProvider
        auth.inMemoryAuthentication().withUser("username").password("password").roles("USER");
        //自定义AuthenticationProvider
        //auth.authenticationProvider(authenticationProvider());

    }

}
